import request from '@/utils/request'

export default {
	// 申请分账获取链接
	shenqingfenzhang() {
		return request({
			url: `/ws/mallStore/shenqingfenzhang`,
			method: 'get',
		})
	},

	// 招商列表
	getRecruitList(data) {
		return request({
			url: `/ws/brandFranchise/list`,
			method: 'get',
			data
		})
	},

	// 招商详情
	getRecruitDetail(data) {
		return request({
			url: `/ws/brandFranchise/detail`,
			method: 'get',
			data
		})
	},

	// 商城订单核销 统计
	mallStatistics(data) {
		return request({
			url: `/ws/mallOrder/writeStatistics`,
			method: 'get',
			data
		})
	},

	// 商城订单核销详情 
	mallOffTicket(data) {
		return request({
			url: `/ws/mallOrder/writer/getOrderInfo`,
			method: 'get',
			data
		})
	},

	// 商城订单核销
	mallOrderWriteOff(data) {
		return request({
			url: `/ws/mallOrder/voucherWrite`,
			method: 'get',
			data
		})
	},

	// 商城核销订单列表
	mallOrderwriteList(data) {
		return request({
			url: `/ws/mallOrder/writedList`,
			method: 'get',
			data
		})
	},

	// 我的收益
	getMyIncome(data) {
		return request({
			url: `/ws/userRich/mineIncomeLogList`,
			method: 'get',
			data
		})
	},

	// 金积分兑换码兑换
	convertMoneyExchange(data) {
		return request({
			url: `/ws/convertMoney/price/exchange`,
			method: 'get',
			data
		})
	},

	// 获取当前活动信息和倒计时
	getActivityInfo() {
		return request({
			url: `/ws/mallActivity/nowActivity`,
			method: 'get',
		})
	},

	//金积分达人/社群达人/合伙人
	getJinjifenInfo() {
		return request({
			url: `/ws/homepage/xiaofeiquanyi`,
			method: 'get',
		})
	},

	// 提货券领取信息
	getVoucherInfo() {
		return request({
			url: `/ws/homepage/exchangeInfo`,
			method: 'get',
		})
	},

	// 折扣套票区列表
	discountList(data) {
		return request({
			url: `/ws/mallVoucher/list`,
			method: 'get',
			data
		})
	},

	// 加盟接口
	join(data) {
		return request({
			url: `/ws/brandFranchise/order`,
			method: 'post',
			data
		})
	},

	// 获取支付成功后红包金额 线下支付
	getJinjifen(data) {
		return request({
			url: `/ws/offlineOrder/getJinjifen`,
			method: 'get',
			data
		})
	},

	// 获取支付成功后红包金额
	getBalance2(data) {
		return request({
			url: `/ws/mallOrder/getJinjifen`,
			method: 'get',
			data
		})
	},

	// 获取支付成功后红包金额
	getBalance(data) {
		return request({
			url: `/ws/mallOrder/getBalance`,
			method: 'get',
			data
		})
	},

	//获取所有未领取金积分红包
	moneyRedPacket() {
		return request({
			url: `/ws/moneyRedPacket/jinjifen`,
			method: 'get',
		})
	},

	//金积分森林单领
	redPacketReceive(id) {
		return request({
			url: `/ws/moneyRedPacket/receive/jinjifen/redPacket/${id}`,
			method: 'get',
		})
	},

	//金积分森林一键领取
	redPacketAll() {
		return request({
			url: `/ws/moneyRedPacket/receive/jinjifen/redPacketAll`,
			method: 'get',
		})
	},





	//兑换
	convertMoney(convertNo) {
		return request({
			url: `/ws/convertMoney/${convertNo}`,
			method: 'get',
		})
	},

	//修改订单地址
	updateOrderAddress(data) {
		return request({
			url: `/ws/mallOrder/update/address`,
			method: 'get',
			data
		})
	},

	// 店铺绑定支付宝账号
	zfbStoreAccount(data) {
		return request({
			url: `/ws/appUser/bind/storeZfbAccount`,
			method: 'get',
			data
		})
	},

	// 绑定支付宝账号
	zfbAccount(data) {
		return request({
			url: `/ws/appUser/bind/zfbAccount`,
			method: 'get',
			data
		})
	},

	//订单角标
	userOrderstatistics(data) {
		return request({
			url: `/ws/mallOrder/userOrder/statistics`,
			method: 'get',
			data
		})
	},

	//签到情况
	signLogInfo(params) {
		return request({
			url: `/ws/signLog/info`,
			method: 'get',
		})
	},

	//签到
	signLogSign(data) {
		return request({
			url: `/ws/signLog/sign`,
			method: 'get',
			data
		})
	},

	//签到列表
	signLogList(params) {
		return request({
			url: `/ws/signLog/list`,
			method: 'get',
			data: params
		})
	},

	//新闻列表
	cms_list(params) {
		return request({
			url: `/cms/text/appList`,
			method: 'get',
			data: params
		})
	},

	//新闻详情
	cms_detail(params) {
		return request({
			url: `/cms/text/${params}`,
			method: 'get',
		})
	},

	// 新闻中心 分类
	cmsAppList(data) {
		return request({
			url: `/cms/cms/appList`,
			method: 'get',
		})
	},

	/**
	 * @param {Object} param 获取app版本
	 */
	getNewVersion(params) {
		return request({
			url: '/system/version/getNewVersion',
			method: 'get',
			params: params
		})
	},

	//地址--查询默认收货
	getDefaultAddress() {
		return request({
			url: `/ws/mallAddress/getDefaultAddress`,
			method: 'get',
		})
	},

	// 商品订单详情
	productOrdersDetail(params) {
		return request({
			url: `/ws/mallOrder/detail/${params}`,
			method: 'get',
			data: params
		})
	},

	// 消费礼包--支付
	giftOrdersPayment(params) {
		return request({
			url: `/special/giftOrders/payment/${params.id}/${params.payPassword}/${params.payWay}`,
			method: 'get',
			data: params
		})
	},

	// 商品订单删除
	appOrdersDelete(params) {
		return request({
			url: `/ws/mallOrder/delete`,
			method: 'get',
			data: params
		})
	},

	/**
	 * @method礼包订单取消订单
	 * @param {Object} id
	 */
	removeById(id) {
		return request({
			url: `/special/giftOrders/removeById/${id}`,
			method: 'DELETE',
		})
	},

	// 通知公告
	getNotice() {
		return request({
			url: `/ws/notice/list`,
			method: 'get',
		})
	},

	// 订单收获
	orderFinished(params) {
		return request({
			url: `/ws/mallOrder/finished`,
			method: 'get',
			data: params
		})
	},


	// 通知详情
	noticeDetail(params) {
		return request({
			url: `/ws/notice/${params}`,
			method: 'get',
		})
	},

	// 消费礼包
	gift_appList(params) {
		return request({
			url: `/system/gift/appList`,
			method: 'get',
			data: params
		})
	},

	// 商品列表
	getProductsList(params) {
		return request({
			url: `/ws/mallSpu/mallSpuList`,
			method: 'get',
			data: params
		})
	},

	// 查询商品详情
	commodityDetail(params) {
		return request({
			url: `/ws/mallSpu/mallSpuInfo/${params}`,
			method: 'get',
		})
	},

	// 查询商品评论数量
	replyConfig(params) {
		return request({
			url: `/ws/mallSpu/reply/config/${params}`,
			method: 'get',
		})
	},

	// 查询商品评论列表
	replyList(id, params) {
		return request({
			url: `/ws/mallSpu/reply/list/${id}`,
			method: 'get',
			params
		})
	},

	// 查询待评价列表
	orderReplyList(params) {
		return request({
			url: `/ws/mallOrder/reply/list`,
			method: 'get',
			params
		})
	},

	// 提交评价
	orderComment(data) {
		return request({
			url: `/ws/mallOrder/reply`,
			method: 'post',
			data
		})
	},

	// 查询	店铺详情
	getStoreInfo(params) {
		return request({
			url: `/ws/mallStore/${params}`,
			method: 'get',
		})
	},

	// 商品/店铺 收藏添加
	addCollection(params) {
		return request({
			url: `/ws/mallCollect/add`,
			method: 'post',
			data: params
		})
	},

	// 商品 取消收藏
	cancelCollection(data) {
		return request({
			url: `/ws/mallCollect/cancel`,
			method: 'get',
			data
		})
	},

	// 查询商品规格
	productSku(params) {
		return request({
			url: `/mall/productsSpu/prodSkuSpecInfo/${params}`,
			method: 'get',
		})
	},

	// 添加购物车
	addCart(params) {
		return request({
			url: `/ws/mallCart/add`,
			method: 'post',
			data: params
		})
	},

	// 生成待支付订单
	addOrder(params) {
		return request({
			url: `/ws/mallOrder/add`,
			method: 'post',
			data: params
		})
	},

	// 商品订单列表
	ordersList(params) {
		return request({
			url: `/ws/mallOrder/list`,
			method: 'get',
			data: params
		})
	},

	// 取消订单
	mallOrderCancel(params) {
		return request({
			url: `/ws/mallOrder/cancel`,
			method: 'get',
			data: params
		})
	},


	// 退款
	refund(data) {
		return request({
			url: `/ws/mallOrder/refund`,
			method: 'get',
			data
		})
	},

	// 查询店铺 -- 列表
	storeList(params) {
		return request({
			url: `/ws/mallStore/list`,
			method: 'get',
			data: params
		})
	},

	// 货币类型列表内部调用
	moneyTypeList(data) {
		return request({
			url: `/admin/moneyType/innerList`,
			method: 'get',
			data
		})
	},

	// 购物车列表
	cartList(params) {
		return request({
			url: `/ws/mallCart/list`,
			method: 'get',
			data: params
		})
	},

	//购物车修改
	cartEdit(params) {
		return request({
			url: `/ws/mallCart/checked`,
			method: 'get',
			data: params
		})
	},

	//购物车删除
	cartRemove(params) {
		return request({
			url: `/ws/mallCart/remove`,
			method: 'get',
			data: params
		})
	},

	/* 
	orderNo
	payway 支付方式 1微信小程序2微信app3支付宝4货币支付5微信 + 货币6支付宝 + 货币
	payPassword 支付密码 货币支付必填
	payConfigId 货币支付id 货币支付必填 
	 */
	orderPay(data) {
		return request({
			url: `/ws/pay/wx/applet/order`,
			method: 'get',
			data
		})
	},

	/**
	 * @method 商家线下支付 获取支付金额（省，赚）
	 * @param {Object} data price 金额 rate 让利比例
	 */
	getPayAmount(data) {
		return request({
			url: `/ws/offlineOrder/getPayAmount`,
			method: 'get',
			data
		})
	},

	//提货卷列表
	marketVoucherList(data) {
		return request({
			url: `/ws/marketVoucher/list`,
			method: 'get',
			data
		})
	},

	//上货保证金支付
	marketBondPay(data) {
		return request({
			url: `/ws/marketBond/pay`,
			method: 'get',
			data
		})
	},

	//提货卷兑换
	marketVoucherexchange(data) {
		return request({
			url: `/ws/marketVoucher/exchangeV2/${data.id}/${data.addressId}`,
			method: 'get',
		})
	},

	//分红信息
	marketDivideInfo() {
		return request({
			url: `/ws/marketDivide/info`,
			method: 'get',
		})
	},

	//分红信息
	moneyRecharge(data) {
		return request({
			url: `/ws/moneyRecharge`,
			method: 'get',
			data
		})
	},

	// 公社信息
	communityInfo() {
		return request({
			url: `/ws/homepage/stockRoom`,
			method: 'get',
		})
	},

	// 公社资产包
	communityAssets() {
		return request({
			url: `/ws/mallSpu/zichanbao`,
			method: 'get',
		})
	},

	// 订单核销
	orderVerification(data) {
		return request({
			url: `/ws/mallOrder/writeOff`,
			method: 'get',
			data
		})
	},

	// 签到周
	signInfoWeek() {
		return request({
			url: `/ws/signLog/signInfo/week`,
			method: 'get',
		})
	},

	// 获取商户入驻地址
	mallStoreYuji() {
		return request({
			url: `/ws/mallStore/yuji`,
			method: 'get',
		})
	},

	// 获取商户银行卡信息
	storeBankCardInfo() {
		return request({
			url: `/ws/withdraw/bankCard`,
			method: 'get',
		})
	},

	// 获取商户银行卡信息
	updateBankCard(data) {
		return request({
			url: `/ws/withdraw/updateBankCard`,
			method: 'get',
			data
		})
	},

	// 予集支付回调
	orderCallback(data) {
		return request({
			url: `/ws/payResult/yj/payCallback`,
			method: 'post',
			data
		})
	},
}